<template>
	<view class="container">
		<view v-if="empty" class="empty">
			<view  class="empty-tips">
				暂无数据
			</view>
		</view>
		<block v-if="!empty">
			<scroll-view class="list-scroll-content" scroll-y="true" @scrolltolower="loadData" style="height: 800px;">
			<view class="wuliu-box" >
				<view class="wuliu-item" v-for="(item,index) in dataList" :key="index">
					<view class="item-note">
						<text>{{item.desc}}</text>
						<text class="money-list-number">+{{item.money}}</text>
					</view>
					<view class="item-time">{{item.create_time}}</view>
				</view>
			</view>
			<uni-load-more :status="loadingType"></uni-load-more>
			</scroll-view>
		</block>
		
	</view>
</template>

<script>

	
	export default {
		data() {
			return {
				dataList:[],
				page:1,
				loadingType:'more',
				empty:true
			}
		},
		onLoad(options) {
			
		},
		onShow() {
			this.loadData()
		},
		methods: {
			async loadData() {
				let _this=this
				this.$http.sendRequest({
					url:"api/member_wallet/commissionList",
					method:"get",
					data:{page:_this.page},
					success:function(res){
						if(res.data.data.length>0){
							_this.dataList = _this.dataList.concat(res.data.data);
							_this.page++
							_this.empty=false
						}else{
							_this.loadingType='nomore'
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.container{
		background-color: #FFFFFF;
		/* 空白页 */
		.empty{
			position:fixed;
			left: 0;
			top:0;
			width: 100%;
			height: 100vh;
			padding-bottom:100upx;
			display:flex;
			justify-content: center;
			flex-direction: column;
			align-items:center;
			background: #fff;
			image{
				width: 240upx;
				height: 160upx;
				margin-bottom:30upx;
			}
			.empty-tips{
				display:flex;
				font-size: $font-sm+2upx;
				color: $font-color-disabled;
				.navigator{
					color: $uni-color-primary;
					margin-left: 16upx;
				}
			}
		}
	}
	.wuliu-box{
		padding: 40upx;
		.wuliu-item{
			margin-bottom: 20upx;
			border-bottom: 1px solid #f1f1f1;
			padding: 20upx;
			.item-note{
				font-size: 28upx;
			}
			.item-time{
				font-size: 24upx;
				margin-top: 20upx;
			}
		}
	}
	.money-list-number{
		font-size: 28upx;
		float: right;
		color: #ED1C24;
	}
</style>
